package com.jbm.jbmsupplier.utlis;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

/**
 *  获取屏幕宽高
 */
public class ScreenAsset {
    //获取屏幕高度
    public  static int getScreenHeight(Context c){
        WindowManager windowManager = (WindowManager)c.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics=new DisplayMetrics();
        windowManager.getDefaultDisplay().getMetrics(outMetrics);


        return outMetrics.heightPixels;
    }
    //获取屏幕宽度
    public  static int getScreenWidth(Context c){
        WindowManager windowManager = (WindowManager)c.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics=new DisplayMetrics();
        windowManager.getDefaultDisplay().getMetrics(outMetrics);
        return outMetrics.widthPixels;
    }

}
